package com.example.rouroudate.ui.widget

import android.os.Bundle
import android.os.PersistableBundle
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import com.example.rouroudate.R
import com.example.rouroudate.util.DisplayUtils
import com.example.rouroudate.util.StatusBarUtils

open class BaseActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        StatusBarUtils.initStatus(this)
        super.onCreate(savedInstanceState)
    }

    override fun setContentView(view: View?) {
        super.setContentView(view)
        val statusBarHeight = StatusBarUtils.getStatusHeight(this)
        view?.findViewById<ViewGroup>(R.id.title_bar)?.apply {
            setPadding(paddingLeft, statusBarHeight, paddingRight, paddingBottom)
            layoutParams.height = DisplayUtils.dp2px(50f) + statusBarHeight
        }
    }
}